//
// Created by lucas on 2023/7/24.
//

#include<stdarg.h>
#include<memory.h>
#include <stdio.h>
#include <string>
#include <assert.h>
#include "ZYLog.h"



namespace ZYUtils {
    void zhiyuan_printf(const char *file, const char *func, int line, const char *fmt, ...) {
#define BUF_LEN 500
        char buf[BUF_LEN];
        va_list args;
        memset(buf, 0, BUF_LEN);
        snprintf(buf, BUF_LEN, "[%s:%d]:", file, line);
        va_start(args, fmt);
        vsnprintf(buf + strlen(buf), BUF_LEN - strlen(buf), fmt, args);
        va_end(args);

        printf("%s\n", buf);

    }

    void zhiyuan_printf_assert(const char *file, const char *func, int line, const char *fmt, ...) {
        zhiyuan_printf(file, func, line, fmt);
        assert(0);
    }
}